// 解密的私钥
const PRIVATEKEY = 'data-meta';
// 弹出层的样式
const initStyleStr = '@keyframes fade-in {0%{opacity: 0}100%{}}\n' +
  '@-webkit-keyframes fade-in { 0%{opacity: 0}100% {}}\n' +
  '@keyframes fade-out {0%{}100%{opacity:0} }\n' +
  '@-webkit-keyframes fade-out{0%{}100% {opacity:0}}\n' +
  '@keyframes modal-in {0%{opacity: 0;transform: scale(0.8, 0.8);-moz-transform: scale(0.8, 0.8);-webkit-transform: scale(0.8, 0.8);-ms-transform: scale(0.8, 0.8);} 100% {} }\n' +
  '@-webkit-keyframes modal-in { 0% {opacity: 0;transform: scale(0.8, 0.8);-moz-transform: scale(0.8, 0.8);-webkit-transform: scale(0.8, 0.8);-ms-transform: scale(0.8, 0.8);} 100% {} }\n' +
  '@keyframes modal-out { 0% {} 100% {transform: scale(0.8, 0.8);-moz-transform: scale(0.8, 0.8);-webkit-transform: scale(0.8, 0.8);-ms-transform: scale(0.8, 0.8);opacity: 0} }\n' +
  '@-webkit-keyframes modal-out { 0% {} 100% {transform: scale(0.8, 0.8);-moz-transform: scale(0.8, 0.8);-webkit-transform: scale(0.8, 0.8);-ms-transform: scale(0.8, 0.8);opacity: 0} }\n' +
  '.weditor-mask-in {animation: fade-in 0.2s;-webkit-animation: fade-in 0.2s;}\n' +
  '.weditor-mask-out {animation: fade-out 0.2s;-webkit-animation: fade-out 0.2s;}\n' +
  '.weditor-modal-in {animation: modal-in 0.15s;-webkit-animation: modal-in 0.15s;}\n' +
  '.weditor-modal-out {animation: modal-out 0.15s;-webkit-animation: modal-out 0.15s;}';

// 弹出层的固定DOM
const domStrTpl = (() => {
  // 手机适配
  let sizeObj = {};
  let ua = navigator.userAgent.toLowerCase();
  if(ua.indexOf("mobile") >= 0){
    sizeObj = {
      outerWidth: 320,
      outerHeight: 266,
      containerHeight: 230
    }
  }else{
    sizeObj = {
      outerWidth: 900,
      outerHeight: 600,
      containerHeight: 500
    }
  }
  return '<div class="weditor-modal-in" style="width:'+sizeObj.outerWidth+'px;height:'+sizeObj.outerHeight+'px;position: absolute;top: 0;left: 0;right: 0;bottom: 0;margin: auto;background-color: #fff;box-shadow: 0 0 8px #666;z-index: 999;">' +
    '<div style="background-color: #f8f8f8;color: #333;height: 36px;line-height: 36px;padding: 0 10px;text-align: center;font-size: 14px;position: relative;">' +
    '<span>{{0}}</span>' +
    '<a class="weditor-close-btn" style="position: absolute;right: 8px;width: 24px;height: 36px;font-size:24px;cursor:pointer;text-decoration:none;">×</a>' +
    '</div>' +
    '<div style="height:'+sizeObj.containerHeight+'px;padding: 0 10px;position:relative;">' +
    'element_placeholder' +
    '</div>' +
    '</div>';
})();

const innerDomStr = {
  nativevideoDefault: '<video preload="none" poster="{{1}}" style="width:90%;display:block;margin:0 auto;" src="{{2}}" controls="controls"></video>',
  nativeaudioDefault: '<audio style="position:absolute;top:50%;left:50%;margin-top:-27px;margin-left:-400px;width:800px;" preload="none" src="{{1}}" controls="controls"></audio>',
  stdIframeDefault: '<iframe src="{{1}}" frameborder="0" width="100%" height="100%" allowfullscreen scrolling="no"></iframe>',
  ZJflashDefault: '<object><embed src="{{1}}"></object>'
}

export {
  PRIVATEKEY,
  initStyleStr,
  domStrTpl,
  innerDomStr
}
